﻿<!-- Phan khai bao bien cuc bo-->
<?php
$v_filter = "";
if(isset($_REQUEST['hdn_filter'])){
	$v_filter= _replace_bad_char(trim($_REQUEST['hdn_filter']));
}	
$v_str_status_checked="";
if ($v_agency_status==1){
	$v_str_status_checked="checked";
}	
$v_str_save_and_add_new_checked="";
if ($v_save_and_add_new==1){
	$v_str_save_and_add_new_checked="checked";
}	
$v_form_name = "f_dsp_single_agency";
//Doan nay dung de tao bo editor DEV-EDITOR
	SetDevEditPath($DEVEDIT_PATH, $DEVEDIT_PATH_FULL	);
	$short_des = new DevEdit();
	$short_des->SetName("txt_detail");
	$short_des->SetLanguage(DE_AMERICAN);
	$short_des->SetPathType(DE_PATH_TYPE_ABSOLUTE);
	$short_des->SetDocumentType(DE_DOC_TYPE_SNIPPET);
	$short_des->EnableGuidelines();
	$short_des->SetTextAreaDimensions("100%","100%");
	$short_des->HideSaveButton();
	//$short_des->SetValue(html_entity_decode( $v_content));
	$short_des->SetValue(( $v_agency_function));
//
?>
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td class="large_title" width="100%"><?php echo CONST_AGENCY_UPDATE_TITLE; ?></td>
	</tr>	
</table>
<table width="100%" class="form_table1">
	<col width="26%"><col width="74%">
	<tr>
		<!--bang chua cac text box de nhap du lieu-->
		<form action="index.php" method="post" enctype="multipart/form-data" Name=<?echo $v_form_name?>>
		<input Type="hidden" Name="fuseaction" value="UPDATE_AGENCY" >
		<input Type="hidden" Name="hdn_agency_id" value="<?php echo $v_agency_id ?>" >
		<input Type="hidden" Name="hdn_item_id" value="<?php echo $v_agency_id ?>" >
		<input type="hidden" name="hdn_save_and_add_new" value="<?php echo $v_save_and_add_new; ?>"> 
		<input type="hidden" name="txt_function" value='<? echo $v_agency_function;?>'>
		<input type="hidden" name="hdn_status" value="<?php echo $v_agency_status ?>" >
		<input type="hidden" name="hdn_agency_status" value="<?php echo $v_agency_status; ?>"> 
		<input type="hidden" name="hdn_filter"  value="<?php echo $v_filter; ?>">
	</tr>
	
	<tr>
<!--Bang chua cac Thong tin-->
	<tr>
		<td class="normal_label" ><?php echo CONST_AGENCY_CODE_LABEL;?><small class="normal_starmark">*</small></td>
	  <td><input name="txt_code" type="text" class="normal_textbox" onKeyDown="change_focus(document.forms(0),this)"  value="<?php echo $v_agency_code; ?>" size="15" maxlength="<?php echo CONST_AGENCY_CODE_MAXLENGTH; ?>" <?php echo $v_str_readonly;?> message="<?php echo CONST_AGENCY_CODE_MESSAGE;?>" optional="<?php echo CONST_AGENCY_CODE_OPTIONAL;?>"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_NAME_LABEL; ?> <small class="normal_starmark">*</small></td>
		<td><input name="txt_name" type="text" class="normal_textbox" id="txt_name" onKeyDown="change_focus(document.forms(0),this)"  value="<?php echo $v_agency_name; ?>" size="30" maxlength="<?php echo CONST_AGENCY_NAME_MAXLENGTH; ?>" <?php echo $v_str_readonly;?> message="<?php echo CONST_AGENCY_NAME_MESSAGE;?>" optional="<?php echo CONST_AGENCY_NAME_OPTIONAL;?>"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_ADDRESS_LABEL; ?> <small class="normal_starmark">*</small></td>
		<td><input name="txt_address" Type="text" class="normal_textbox" id="txt_address" onKeyDown="change_focus(document.forms(0),this)" value="<?php echo $v_agency_address; ?>" size="30" maxlength="<?php echo CONST_AGENCY_ADDRESS_MAXLENGTH;?>" <?php echo $v_str_readonly;?> message="<?php echo CONST_AGENCY_ADDRESS_MESSAGE;?>" optional="<?php echo CONST_AGENCY_ADDRESS_OPTIONAL;?>"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_EMAIL_LABEL; ?></td>
		<td><input name="txt_email" Type="text" class="normal_textbox" id="txt_email" onKeyDown="change_focus(document.forms(0),this)" value="<?php echo $v_agency_email; ?>" size="30" optional="false"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_WEBSITE_LABEL; ?></td>
		<td><input name="txt_website" Type="text" class="normal_textbox" id="txt_website" onKeyDown="change_focus(document.forms(0),this)" value="<?php echo $v_agency_website; ?>" size="30" optional="false"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_MOBILE_LABEL; ?></td>
		<td><input name="txt_mobile" Type="text" class="normal_textbox" id="txt_mobile" onKeyDown="change_focus(document.forms(0),this)" value="<?php echo $v_agency_mobile; ?>" size="15" optional="false"></td>
	</tr>	
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_TEL_LABEL; ?></td>
		<td><input name="txt_tel" Type="text" class="normal_textbox" id="txt_tel" onKeyDown="change_focus(document.forms(0),this)" value="<?php echo $v_agency_tel; ?>" size="15" optional="false"></td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_AGENCY_ORDER_LABEL; ?></td>
		<td><input name="txt_order" Type="text" class="short_number_textbox"  onKeyDown="change_focus(document.forms(0),this);" value="<?php echo $v_agency_order; ?>" size="5" maxlength="<?php echo CONST_AGENCY_ORDER_MAXLENGTH;?>" <?php echo $v_str_readonly;?> message="<?php echo CONST_AGENCY_ORDER_MESSAGE;?>" optional="<?php echo CONST_AGENCY_ORDER_OPTIONAL;?>" isnumeric min="<?php echo CONST_AGENCY_ORDER_MIN; ?>" max="<?php echo CONST_AGENCY_ORDER_MAX; ?>"></td>
	</tr>
	<tr>
		<td class="normal_label" colspan="3"><?php echo CONST_AGENCY_FUNCTION_LABEL; ?></td>
	</tr>
	<tr>
		<td colspan="12">
			<!-- ~~~~~~~~~~~~~~~~~ ISA Editor    ~~~~~~~~~~~ -->
			<?php $short_des->ShowControl("100%", "300", $IMAGE_NEWS);?>		
		</td>
	</tr>
	<tr>
	<!--	<td>&nbsp;</td> -->
		<td><input type="checkbox" name="chk_status" class="normal_checkbox" <?php echo $v_str_status_checked;?> onClick="btn_single_checkbox_onclick(document.forms(0).chk_status,document.forms(0).hdn_agency_status)" onKeyDown="change_focus(document.forms(0),this)"> <?php echo _CONST_STATUS_COLUMN_ACTIVE_VALUE;?></td>
	</tr>
	<tr>	
	<!--	<td height="37"></td> -->
		<td><input type="checkbox" name="chk_save_and_add_new" class="normal_checkbox" <?php echo $v_str_save_and_add_new_checked; ?> onclick="btn_single_checkbox_onclick(document.forms(0).chk_save_and_add_new,document.forms(0).hdn_save_and_add_new)" onKeyDown="change_focus(document.forms(0),this)"><?php echo _CONST_SAVE_AND_ADD_NEW_LABEL;?></td>
	</tr>
	<tr><td height="5">&nbsp;</td></tr>
	
</table>

<!--bang chua cac button-->
<table width="100%" >
	<tr>
		<td align="center" width="100%" height="40" valign="bottom"><?php
			if ($v_is_granted_update){?>
				<input Type="button" Name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_onclick('UPDATE_AGENCY')" onKeyDown="change_focus(document.forms(0),this)"><?php
			}?>	
			<input Type="button" Name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">	
		</td>
	</tr>
</table>					
</form>
</div>
<script language="JavaScript">
	set_focus(document.forms(0));
	window.dialogHeight = "340pt";
	window.dialogWidth = "420pt";
	window.dialogTop = "80pt";
</script>
